1. Technology Field
The present invention relates to a memory management method. Particularly, the present invention relates to a memory management method for managing a rewritable non-volatile memory module, and a memory controller and a memory storage apparatus using the same.
2. Description of Related Art
Digital cameras, cell phones, and MP3 players have undergone rapid growth in recent years, so that consumer demand for storage media have also rapid increased. A rewritable non-volatile memory is one of the most adaptable memories for electronic products (for example, notebook computers) due to its characteristics such as data non-volatility, low power consumption, small volume, non-mechanical structure, and high read-and-write speed. A solid state drive (SSD) is a storage apparatus which uses a flash memory as its storage medium. Thus, in recent years, the flash memory industry has become a major part of the electronic industry.
Memory sub-modules of a rewritable non-volatile memory module have a plurality of physical units, and each of the physical units is composed of one or a plurality of physical blocks, and each physical block has a plurality of physical pages, where when data is written into the physical block, it has to be sequentially written according to a sequence of the physical pages. Moreover, the physical pages written with data have to be erased first for again writing data thereon. Particularly, the physical block is the smallest unit that can be erased, and the physical page is the smallest unit that can be programmed (written). Therefore, in management of the flash memory module, the physical units are grouped into a data area and a free area.
The physical units of the data area are used for storing data stored by a host system. In detail, a memory management circuit converts a logical access address accessed by the host system into a logical page of a logical unit, and maps the logical page of the logical unit to a physical page of a physical unit of the data area. Namely, in management of the rewritable non-volatile memory module, the physical units of the data area are regarded as used physical units (for example, stored with data written by the host system). For example, the memory management circuit may use a logical unit-physical unit mapping table to record a mapping relationship between the logical units and the physical units of the data area, where the logical pages of the logical unit sequentially correspond to the physical pages of the mapped physical unit.
The physical units of the free area are used to substitute the physical units of the data area. In detail, as described above, the physical block written with data has to be erased first for again writing data thereon, so that the physical units of the free area are designed to be written with updated data to substitute the physical units originally mapped to the logical unit. Therefore, the physical units in the free area are empty or available physical units, i.e. physical units that are not stored with data or physical units stored with data marked to be invalid.
Namely, in management of the rewritable non-volatile memory module, the physical pages of the physical units of the data area and the free area are used to map the logical pages of the logical units in an alternate approach, so as to store the data written by the host system. Therefore, how to effectively manage the physical units of the data area and the free area to shorten the time for executing a write command is an important issue to be developed by related practitioners.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.